package com.xinqi.common.base.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

public enum QrCodeEnum implements BasicEnum {

    QR_LOGIN(0, "登录二维码"),
    QR_ADD_CLASS(1, "加课码"),
    QR_ATTENDANCE(2, "考勤二维码"),
    QR_PERSONAL(3, "个人二维码"),
    QR_GROUP(4, "群组二维码");


    @Getter(onMethod_ = {@JsonValue})
    private final int code;

    @Getter
    private final String describe;

    QrCodeEnum(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static QrCodeEnum of(Integer code) {
        return BasicEnum.of(QrCodeEnum.class, code);
    }

}
